#include "ohos_init.h"
#include "cmsis_os2.h"
#include "stdio.h"
void task1(void )
{
    while(1)
    {
        printf("hello !");
        sleep(1);
    }
}

void task2(void )
{
    while(1)
    {
        printf("hello task2");
        sleep(5);
    }
}

 void thread()
 {
    osThreadAttr_t attr;
    attr.name="task1321";
    attr.stack_size=1024;
    attr.priority=20;
    if(osThreadNew(task1,NULL,&attr)==NULL )
        {printf("failed");}
    attr.name="task2";
    attr.stack_size=1024;
    attr.priority=20;
    if(osThreadNew(task2,NULL,&attr)==NULL )
        {printf("failed");}

 }
 SYS_RUN(thread);

